package ldh.im.fxgui.pojo;

import ldh.im.fxbase.data.pojo.ImDepartment;
import ldh.im.fxbase.data.pojo.ImUser;

public class DepartmentUserItem {

    private ImDepartment imDepartment;
    private ImUser imUser;

    public DepartmentUserItem(ImDepartment imDepartment) {
        this.imDepartment = imDepartment;
    }

    public DepartmentUserItem(ImUser imUser) {
        this.imUser = imUser;
    }

    public ImDepartment getImDepartment() {
        return imDepartment;
    }

    public void setImDepartment(ImDepartment imDepartment) {
        this.imDepartment = imDepartment;
    }

    public ImUser getImUser() {
        return imUser;
    }

    public void setImUser(ImUser imUser) {
        this.imUser = imUser;
    }

    public String getName() {
        if (imDepartment != null) return imDepartment.getName();
        return imUser.getUserName();
    }
}
